﻿using System.Collections.Generic;
using System.Linq;

namespace Ipmce.RemoteVoting.Backend.DataAccess
{
	public class CandidateListProvider : ICandidateListProvider
	{
		private readonly RemoteVotingContext _context;

		public CandidateListProvider(RemoteVotingContext context)
		{
			_context = context;
		}

		public IList<Common.Entities.Candidate> GetCandidateList()
		{
			return _context.Candidates.Select(c => new Common.Entities.Candidate
			                                       	{
			                                       		Fio = c.Fio,
														Id = c.Id
			                                       	}).ToList();
		}
	}
}